<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <input v-model="user.username" name="username" @blur="f()" placeholder="用户名"><span>{{info}}</span></span><br>
  <input v-model="user.password" name="password" placeholder="密码"><br>
  <input v-model="user.nick" name="nick" placeholder="昵称"><br>
  <input type="button" value="注册" v-on:click="reg()">
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
   <script src=" https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
     <script>
       let v=new Vue({
         el:"body>div",
         data:{
            user:{ username:"",
             password:"",
             nick:""},
             info:"",
         },
         methods:{
             reg(){
                 axios.post("/regA",v.user).then(function (p) {
                     p.data;
                 })
             },
             f(){
                 axios.get("/check?username="+v.user.username).then(function (rp) {
                     v.info=rp.data
                 })
                 console.log("用户名"+v.user.username)
             },


         }
       })

     </script>
</body>
</html>